describe('Tune.coffee', ->
  beforeEach ->
    # do nothing

  describe('Tune class ', ->
    it 'constructs (@todo)', ->
      file_stub1 =  jasmine.createSpy('FileStub')
      file_stub1.name = 'C:\Users\nato\Documents\test.mp3'
      target = new Tune(file_stub1, 100)

      expect(target.name).toEqual(file_stub1.name)
      expect(target.owner_session_id).toEqual(100)
      expect(target.requester_session_id).toBeNull()

    it 'can copmare with name and owner (@todo)', ->
      file_stub1 =  jasmine.createSpy('FileStub')
      file_stub1.name = 'C:\Users\nato\Documents\test.mp3'
      target = new Tune(file_stub1, 100)

      file_stub2 =  jasmine.createSpy('FileStub')
      file_stub2.name = 'test.mp3'
      same = new Tune(file_stub2, 100)

      file_stub3 =  jasmine.createSpy('FileStub')
      file_stub3.name = 'test1.mp3'
      differ1 = new Tune(file_stub3, 100)

      file_stub4 =  jasmine.createSpy('FileStub')
      file_stub4.name = 'C:\Users\nato\Documents\test.mp3'
      differ2 = new Tune(file_stub4, 101)

      expect(target.is_same_name_and_owner(same)).toBeTruthy()
      expect(target.is_same_name_and_owner(differ1)).toBeTruthy()
      expect(target.is_same_name_and_owner(differ2)).toBeFalsy()

    it 'could be set by object', ->
      file_stub1 =  jasmine.createSpy('FileStub')
      file_stub1.name = 'C:\Users\nato\Documents\test.mp3'
      target = new Tune(file_stub1, 100)
      
      file_stub2 =  jasmine.createSpy('FileStub')
      file_stub2.name = 'test.mp3'
      differ1 = new Tune(file_stub2, 100)
      target.set(differ1)

      expect(target.owner_session_id).toEqual(differ1.owner_session_id)
      expect(target.requester_session_id).toEqual(differ1.requester_session_id)
      expect(target.name).toEqual(differ1.name)
  )
) 